<?php
namespace app\index\controller;
use app\index\model\Teacher;
use app\index\model\Student;

class Login{
    public function teacherLogin(){    //教师登录
        $res = input("post.");
        $x = Teacher::get($res["t_id"]);
        if ($x==null){
            return false;
        }else{
            if (md5($res["t_pwd"])==$x["pwd"]) {
                return true;
            }else{
                return false;
            }
        }
    }

    public function studentLogin(){
        $res = input("post.");
        $x = Student::get($res["s_id"]);
        if ($x==null){
            return false;
        }else{
            if (md5($res["s_pwd"])==$x["pwd"]) {
                return true;
            }else{
                return false;
            }
        }
    }
}